<template>
  <div class="order">
    <div class="order-group" v-for="(orders, key) in list" :key="key">
      <OrderDataItem v-for="orderItem in orders" :order="orderItem" :key="orderItem.id" />
    </div>

    <Subscribe v-model="state.orderData.subscribe.show" :data="state.orderData.subscribe.data" />
  </div>
</template>
<script setup>
import OrderDataItem from './OrderDataItem.vue'
import Subscribe from './Subscribe.vue'

const { state, store } = inject('Home')

const list = computed(() => {
  return state.orderData.type == 0 ? state.orderData.list : state.orderData.reservationList
})
</script>
<style lang="scss" scoped>
.order-group {
  padding-top: 8px;
  padding-right: 8px;
}
</style>
